package com.mediator.pattern;

/**
 * @author chenchen
 * @description 房产中介
 * @date 2023/9/26 10:33
 */
public class HouseMediator extends Mediator {
    private Person renter;
    private Person landlord;

    @Override
    void send(String message, Person person) {
        if (person.equals(renter)) {
            landlord.getMessage(message);
        } else {
            renter.getMessage(message);
        }
    }

    @Override
    void setLandlord(Person landlord) {
        this.landlord = landlord;
    }

    @Override
    void setRenter(Person renter) {
        this.renter = renter;
    }
}
